#ifndef COMBO_CHECKER_H
#define COMBO_CHECKER_H

// combo_checker.h


#include <QObject>
#include <QWidget>
#include <QGraphicsScene>
#include <QGraphicsPixmapItem>
#include <QGraphicsView>
#include <functional>
#include "clothes_data.h"
#include "dragable_item.h"

class ScaleManager;

class ComboChecker : public QObject
{
    Q_OBJECT
public:
    explicit ComboChecker(QObject *parent = nullptr);

    // 检查并显示套装（返回是否匹配成功）
    bool checkAndShowCombo(
        DragablePixmapItem *upItem, 
        DragablePixmapItem *downItem,
        DragablePixmapItem *dressItem, 
        DragablePixmapItem *shoesItem,
        const QList<OutfitCombo> &combos,
        const std::function<ClothesInfo(DragablePixmapItem*)> &getInfoFunc,
        QGraphicsScene *scene, 
        QGraphicsPixmapItem *&comboItem,
        QString &currentComboPath, 
        bool &showingCombo,
        QWidget *parentWidget,
        QGraphicsPixmapItem *characterItem,
        const QSize &windowSize
    );

    // 隐藏合成图
    void hideCombo(QGraphicsScene *scene, QGraphicsPixmapItem *&comboItem,
                  QString &currentComboPath, bool &showingCombo);

    // 缩放并定位合成图到指定窗口大小
    void scaleAndPositionCombo(QGraphicsPixmapItem *comboItem, const QString &comboPath,
                              const QSize &windowSize, QGraphicsView *view = nullptr);
};

#endif // COMBO_CHECKER_H

